# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadata do
  @moduledoc """
  Metadata describing the Model's input and output for explanation.

  ## Attributes

  *   `featureAttributionsSchemaUri` (*type:* `String.t`, *default:* `nil`) - Points to a YAML file stored on Google Cloud Storage describing the format of the feature attributions. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). AutoML tabular Models always have this field populated by Vertex AI. Note: The URI given on output may be different, including the URI scheme, than the one given on input. The output URI will point to a location where the user only has a read access.
  *   `inputs` (*type:* `%{optional(String.t) => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadataInputMetadata.t}`, *default:* `nil`) - Required. Map from feature names to feature input metadata. Keys are the name of the features. Values are the specification of the feature. An empty InputMetadata is valid. It describes a text feature which has the name specified as the key in ExplanationMetadata.inputs. The baseline of the empty feature is chosen by Vertex AI. For Vertex AI-provided Tensorflow images, the key can be any friendly name of the feature. Once specified, featureAttributions are keyed by this key (if not grouped with another feature). For custom images, the key must match with the key in instance.
  *   `latentSpaceSource` (*type:* `String.t`, *default:* `nil`) - Name of the source to generate embeddings for example based explanations.
  *   `outputs` (*type:* `%{optional(String.t) => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadataOutputMetadata.t}`, *default:* `nil`) - Required. Map from output names to output metadata. For Vertex AI-provided Tensorflow images, keys can be any user defined string that consists of any UTF-8 characters. For custom images, keys are the name of the output field in the prediction to be explained. Currently only one key is allowed.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :featureAttributionsSchemaUri => String.t() | nil,
          :inputs =>
            %{
              optional(String.t()) =>
                GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadataInputMetadata.t()
            }
            | nil,
          :latentSpaceSource => String.t() | nil,
          :outputs =>
            %{
              optional(String.t()) =>
                GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadataOutputMetadata.t()
            }
            | nil
        }

  field(:featureAttributionsSchemaUri)

  field(:inputs,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadataInputMetadata,
    type: :map
  )

  field(:latentSpaceSource)

  field(:outputs,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadataOutputMetadata,
    type: :map
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadata do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadata.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExplanationMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
